#include "lcd_log.h"

extern ConfigParam SDConfig;

RUN_IN_SRAM void PrintPuts(char * str)
{
    while(*str)
    {
        Putchar(*str++);
    }

}


RUN_IN_SRAM void PrintDebug(const char* level, const char *file_name, unsigned int line,
				const char *func_name, const char *format, ...)
{
	va_list arglist;
    if(SDConfig.DebugPrint>0)
    {
       printf("[%s][file:%s][line:%d][fun:%s]:",
           level,
           file_name,
           line,
           func_name);
        va_start(arglist, format);
        vprintf(format, arglist);
        va_end(arglist);
       // printf("\r\n");
    }
}

void DumpPrint(uint8_t *ptr ,uint32_t length)
{
    if(ptr==NULL)
        return ;
    for(uint32_t i = 0; i <length ;i++ )
    {
        printf("%.2X ",ptr[i]);
        if((i+1 )%8 ==0)
        {
            printf(" ");
        }
        if((i+1 )%16 ==0)
        {
            printf("\r\n");
        }
    }

    printf("\r\n");

}
